function count(x: number, y: number): number {
    return x + y
}

let result = count(1, 2)

//console.log(result)

enum Direction {
    UP,
    DOWN,
    LEFT,
    RIGHT
}

//console.log(Direction)

function walk(data: Direction): void {
    if (data == Direction.UP) {
        console.log("上")
    } else if (data == Direction.DOWN) {
        console.log("下")
    } else if (data == Direction.LEFT) {
        console.log("左")
    } else if (data == Direction.RIGHT) {
        console.log("右")
    } else {
        console.log("走错了")
    }
}

walk(Direction.UP)

//type

type Status = number | string

function printStatus(data: Status): void {
    console.log(data)
}

printStatus(404)
printStatus("404")


type  Gender = "男" | "女" | "未知"

function printGender(data: Gender): void {
    console.log(data)
}

printGender("男")
printGender("未知")


type Area = {
    width: number,
    height: number
}

type Address = {
    num: number,
    cell: number,
    room: string,
}

type House = Area & Address

const house: House = {
    width: 100,
    height: 100,
    num: 1,
    cell: 1,
    room: "201",
}

console.log(house)
